package com.tang.tasks.zentao;

import com.intellij.openapi.project.Project;
import com.intellij.tasks.config.BaseRepositoryEditor;
import com.intellij.ui.components.JBLabel;
import com.intellij.util.Consumer;
import com.intellij.util.ui.FormBuilder;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;

/**
 * LuaTaskRepositoryEditor
 * Created by TangZX on 2017/1/10.
 */
class ZentaoTaskRepositoryEditor extends BaseRepositoryEditor<ZentaoTaskRepository> {
    ZentaoTaskRepositoryEditor(Project project, ZentaoTaskRepository repository, Consumer<ZentaoTaskRepository> changeListener) {
        super(project, repository, changeListener);
    }

    @Nullable
    @Override
    protected JComponent createCustomPanel() {
        return FormBuilder.createFormBuilder()
                .addLabeledComponent(new JBLabel("fs"), new JBLabel(""))
                .getPanel();
    }

    @Override
    protected void afterTestConnection(boolean connectionSuccessful) {
        System.out.println("afterTestConnection");
        if (connectionSuccessful) {
            myRepository.login();
        }
    }
}
